//
//  NetworkTool.h
//  WANTS购物
//
//  Created by xuNick on 16/5/28.
//  Copyright © 2016年 NN. All rights reserved.
//
#import <Foundation/Foundation.h>

#import <AFNetworking/AFNetworking.h>

// 定义请求方式的格式
typedef NS_ENUM(NSUInteger, RequestMethod) {
    RequestMethodGet,
    RequestMethodPost
};

@interface NetworkTool : AFHTTPSessionManager


+(instancetype)shareNetworkTool;

//网络请求
- (void)request:(RequestMethod)method urlString:(NSString *)urlString parameters:(id)parameters finished:(void(^)(id responseObject, NSError *error))finished;


//用第三方框架检查网络连接是否正常的方法  (用在登录判断中)
- (BOOL)isReachableByAFN;


@end
